package com.jian.common;

import lombok.Data;

/**
 * 改项目统一返回类
 *
 * @author 太难了
 */
@Data
public class BaseResponse {
    private int statusCode;
    Object data;
    private String message;
    private String description;

    public BaseResponse() {
    }

    public BaseResponse(int statusCode, Object data, String message, String description) {
        this.statusCode = statusCode;
        this.data = data;
        this.message = message;
        this.description = description;
    }

    public BaseResponse(int statusCode, String message, String description) {
        this(statusCode,null,message,description);
    }

    public BaseResponse(ErrorCode errorCode, String description) {
        this(errorCode.getCode(), errorCode.getMessage(), description);
    }

    public BaseResponse(ErrorCode errorCode) {
        this(errorCode.getCode(), errorCode.getMessage(),null);
    }
}
